<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <script src="/static/js/jquery-3.4.1.min.js"></script>
    <link href="/static/bootstrap-3.3.7/css/bootstrap.min.css" rel="stylesheet">
    <script src="/static/bootstrap-3.3.7/js/bootstrap.min.js"></script>
    <link href="/static/bootsnav/css/bootsnav.css" rel="stylesheet">
    <script src="/static/bootsnav/js/bootsnav.js"></script>
    <link href="/static/bootsnav/another/css/animate.css" rel="stylesheet">
    <link href="/static/font-awesome-4.7.0/css/font-awesome.min.css" rel="stylesheet">
    <link href="/static/sweetalert/sweetalert.css" rel="stylesheet">
    <script src="/static/sweetalert/sweetalert.js/"></script>
    <title>执法人员编辑</title>
    <style>
        h3 {
            color: #c64743
        }
        .form-horizontal .form-group {
            margin: 0;
        }
        .pageheader {
            padding-top: 30px;
            padding-bottom: 30px;
            margin-bottom: 20px;
        }
    </style>
</head>
<body>
<div class="container">
    <form class="form-horizontal" role="form" novalidate method="post" onsubmit="return myfun()">
        <h3>执法人员编辑</h3>
        {% csrf_token %}
        <!--基本信息-->
        <div class="row">
            <div class="panel panel-info">
                <div class="panel-heading" data-toggle="collapse" data-parent="#accordion" href="#collapse1">
                    注册个人信息
                </div>
                <div id="collapse1" class="panel-collapse collapse in">
                    <div class="panel-body">
                        <!-- 姓名 -->
                        <div class="form-group col-md-3 {% if obj.name.errors.0 %}has-error{% endif %}">
                            <label for="id_name">{{ obj.name.label }}</label>
                            {{ obj.name }}
                            <span class="help-block">{{ obj.name.errors.0 }}</span>
                        </div>
                        <!-- 手机号码 -->
                        <div class="form-group col-md-3 {% if obj.phone.errors.0 %}has-error{% endif %}">
                            <label for="id_phone">{{ obj.phone.label }}</label>
                            {{ obj.phone }}
                            <span class="help-block">{{ obj.phone.errors.0 }}</span>
                        </div>

                        <!-- 身份证号码 -->
                        <div class="form-group col-md-3 {% if obj.sfzhm.errors.0 %}has-error{% endif %}">
                            <label for="id_sfzhm">{{ obj.sfzhm.label }}</label>
                            {{ obj.sfzhm }}
                            <span class="help-block">{{ obj.sfzhm.errors.0 }}</span>
                        </div>
                        <!-- 密码 -->
                        <div class="form-group col-md-3 {% if obj.password.errors.0 %}has-error{% endif %}">
                            <label for="id_password">{{ obj.password.label }}</label>
                            {{ obj.password }}
                            <span class="help-block">{{ obj.password.errors.0 }}</span>
                        </div>
                        <!-- 询问人 -->
                        <div class="form-group col-md-3 {% if obj.xueli.errors.0 %}has-error{% endif %}">
                            <label for="id_xueli">{{ obj.xueli.label }}</label>
                            {{ obj.xueli }}
                            <span class="help-block">{{ obj.xueli.errors.0 }}</span>
                        </div>
                        <!-- 是否专业军人 -->
                        <div class="form-group col-md-3 {% if obj.junren.errors.0 %}has-error{% endif %}">
                            <label for="id_junren">{{ obj.junren.label }}</label>
                            {{ obj.junren }}
                            <span class="help-block">{{ obj.junren.errors.0 }}</span>
                        </div>
                        <!-- 是否法律专业 -->
                        <div class="form-group col-md-3 {% if obj.falv.errors.0 %}has-error{% endif %}">
                            <label for="id_falv">{{ obj.falv.label }}</label>
                            {{ obj.falv }}
                            <span class="help-block">{{ obj.falv.errors.0 }}</span>
                        </div>
                        <!-- 是否有执法证 -->
                        <div class="form-group col-md-3 {% if obj.zfz.errors.0 %}has-error{% endif %}">
                            <label for="id_zfz">{{ obj.zfz.label }}</label>
                            {{ obj.zfz }}
                            <span class="help-block">{{ obj.zfz.errors.0 }}</span>
                        </div>
                        <!-- 省辖市 -->
                        <div class="form-group col-md-3 {% if obj.xzqh.errors.0 %}has-error{% endif %}">
                            <label for="id_xzqh">{{ obj.xzqh.label }}</label>
                            {{ obj.xzqh }}
                            <span class="help-block">{{ obj.xzqh.errors.0 }}</span>
                        </div>
                        <!-- 单位 -->
                        <div class="form-group col-md-3 {% if obj.organization.errors.0 %}has-error{% endif %}">
                            <label for="id_organization">{{ obj.organization.label }}</label>
                            {{ obj.organization }}
                            <span class="help-block">{{ obj.organization.errors.0 }}</span>
                        </div>
                        <!-- 编制类型 -->
                        <div class="form-group col-md-3 {% if obj.bzlx.errors.0 %}has-error{% endif %}">
                            <label for="id_bzlx">{{ obj.bzlx.label }}</label>
                            {{ obj.bzlx }}
                            <span class="help-block">{{ obj.bzlx.errors.0 }}</span>
                        </div>
                        <!-- 工资保障 -->
                        <div class="form-group col-md-3 {% if obj.gzbz.errors.0 %}has-error{% endif %}">
                            <label for="id_gzbz">{{ obj.gzbz.label }}</label>
                            {{ obj.gzbz }}
                            <span class="help-block">{{ obj.gzbz.errors.0 }}</span>
                        </div>
                    </div>
                </div>
            </div>

        </div>
        <div class="col-md-6 col-md-offset-3" style="text-align: center;margin-top: 20px">
            <input type="reset" value="重置" class="btn btn-info">
            <input type="submit" value="提交" class="btn btn-success">
        </div>
    </form>
</div>
</body>
<script>
    $(':input:not(.btn,#id_dsr_isgr)').addClass('form-control')
    $('#id_xzqh').change(function () {
        $.ajax({
            url: "/hqdw/" + $(this).val() + "/",
            dataType: "json",
            success: function (d) {
                if (d.n == 200) {
                    $("#id_organization").empty()
                    $.each(d.data, function (i, n) {
                        $("#id_organization").append('<option value="' + n[0] + '">' + n[1] + '</option>')
                    })
                }

            }
        })
    })
</script>
</html>